package DataStore
{
	import flash.utils.Dictionary;
	public class DataSource
	{
		public static var sourceMapUrl:String = "../Resource/Image/Menu/MapSourceMake.png";
		public static var propsUrl:String = "../Resource/Image/Props/CommProp.xml";
		public static var propImg:String = "../Resource/Image/Props/CommProp1.png";
		public static var thunbnailDir:String = "../Resource/Image/Menu/"; 
		public static var thumbnails:Array =  
			[
				["征战天下", "ThumbnailPng.png"],
			    ["虎牢关", "ThumbnailPng2.png"],
			    ["博望坡之战", "ThumbnailPng3.png"]];
		
		//消息辨识码
		public static var MsgMins:Dictionary = new Dictionary(); 		                                                        
		public static var FramAnimationUnit:String = "FramAnimationUnit";	
		public static var AnimationTest:String = "AnimationTest";
		
		private static var KeyToCode:Dictionary = new Dictionary();
		private static var CodeToKey:Dictionary = new Dictionary();		
		
		private static var SoliderType:Dictionary = new Dictionary();
				
		public function DataSource()
		{
		}
		
		public static function Init():void
		{
			InitKeyDict();
			InitMsgMin();
			InitSoliderType();
		}
		
		public static function GetKey(_code:uint):String
		{
			return CodeToKey[_code];
		}
		
		public static function GetCode(_key:String):uint
		{
			return KeyToCode[_key];
		}
		
		public static function GetSoliderType(_key:String):int
		{
			return SoliderType[_key];
		}
		
		private static function InitMsgMin():void
		{
			MsgMins["Update"] = "Update";
			MsgMins["SwitchAnimation"] = "SwitchAnimation";
			MsgMins["KeyDown"] = "KeyDown";
			MsgMins["KeyUp"] = "KeyUp";
		}	
				
		private static function InitKeyDict():void
		{
		      KeyToCode["0"]=    48 ;
              KeyToCode["1"]=    49 ;
              KeyToCode["2"]=    50 ;
              KeyToCode["3"]=    51 ;
              KeyToCode["4"]=    52 ;
              KeyToCode["5"]=    53 ;
              KeyToCode["6"]=    54 ;
              KeyToCode["7"]=    55 ;
              KeyToCode["8"]=    56 ;
              KeyToCode["9"]=    57 ;
              KeyToCode["A"]=    65 ;
              KeyToCode["B"]=    66 ;
              KeyToCode["C"] =   67 ;
              KeyToCode["D"]=    68 ;
              KeyToCode["E"]=    69 ;
              KeyToCode["F"]=    70 ;
              KeyToCode["G"]=    71 ;
              KeyToCode["H"]=    72 ;
              KeyToCode["I"]=    73 ;
              KeyToCode["J"]=    74 ;
              KeyToCode["K"]=    75 ;
              KeyToCode["L"]=    76 ;
              KeyToCode["M"]=    77 ;
              KeyToCode["N"]=    78 ;
              KeyToCode["O"]=    79 ;
              KeyToCode["P"]=    80 ;
              KeyToCode["Q"]=    81 ;
              KeyToCode["R"]=    82 ;
              KeyToCode["S"]=    83 ;
              KeyToCode["T"]=    84 ;
              KeyToCode["U"]=    85 ;
              KeyToCode["V"]=    86 ;
              KeyToCode["W"]=    87 ;
              KeyToCode["X"]=    88 ;
              KeyToCode["Y"]=    89 ;
              KeyToCode["Z"] =   90 ;
			  KeyToCode["Left"]  = 37 ;
			  KeyToCode["Up"]    = 38 ;
			  KeyToCode["Right"] = 39 ;
			  KeyToCode["Down"]  = 40 ;
			  KeyToCode["Space"] = 32 ;
			  KeyToCode["Shift"] = 16 ;
			  KeyToCode["Ctrl"]  = 17 ;
			  KeyToCode["Esc"]   = 27 ;
			 
			  
			  CodeToKey[48] = 0  ;
              CodeToKey[49] = 1  ;
              CodeToKey[50] = 2  ;
              CodeToKey[51] = 3  ;
              CodeToKey[52] = 4  ;
              CodeToKey[53] = 5  ;
              CodeToKey[54] = 6  ;
              CodeToKey[55] = 7  ;
              CodeToKey[56] = 8  ;
              CodeToKey[57] = 9  ;
              CodeToKey[65] = "A" ;
              CodeToKey[66] = "B" ;
              CodeToKey[67] = "C" ;
              CodeToKey[68] = "D" ;
              CodeToKey[69] = "E" ;
              CodeToKey[70] = "F" ;
              CodeToKey[71] = "G" ;
              CodeToKey[72] = "H" ;
              CodeToKey[73] = "I" ;
              CodeToKey[74] = "J" ;
              CodeToKey[75] = "K" ;
              CodeToKey[76] = "L" ;
              CodeToKey[77] = "M" ;
              CodeToKey[78] = "N" ;
              CodeToKey[79] = "O" ;
              CodeToKey[80] = "P" ;
              CodeToKey[81] = "Q" ;
              CodeToKey[82] = "R" ;
              CodeToKey[83] = "S" ;
              CodeToKey[84] = "T" ;
              CodeToKey[85] = "U" ;
              CodeToKey[86] = "V" ;
              CodeToKey[87] = "W" ;
              CodeToKey[88] = "X" ;
              CodeToKey[89] = "Y" ;
              CodeToKey[90] = "Z" ;
			  
			  CodeToKey[37] = "Left";
			  CodeToKey[38] = "Up";
			  CodeToKey[39] = "Right";
			  CodeToKey[40] = "Down";
			  CodeToKey[32] = "Space";
			  CodeToKey[16] = "Shift";
			  CodeToKey[17] = "Ctrl";
			  CodeToKey[27] = "Esc";	 			  
		}  
		
		private static function InitSoliderType():void
		{
			SoliderType["CounsellorFoot-1"] = 0;
			SoliderType["CounsellorFoot-2"] = 1;
			SoliderType["CounsellorFoot-3"] = 2;			
			SoliderType["CounsellorHorse-1"] = 3;
			SoliderType["CounsellorHorse-2"] = 4;			
			SoliderType["SpearFoot-2"] = 5;
			SoliderType["BearMan"] = 6;			
			SoliderType["ArcherFoot-1"] = 7;
			SoliderType["ArcherHorse-1"] = 8;			
			SoliderType["Cart"] = 9;
			SoliderType["WoodOX"] = 10;			
			SoliderType["Catapult-1"] = 11;
			SoliderType["Catapult-2"] = 12;
			SoliderType["Catapult-3"] = 13;			
			SoliderType["CrossbowManFoot-1"] = 14;
			SoliderType["CrossbowManFoot-2"] = 15;
			SoliderType["CrossbowManFoot-3"] = 16;			
			SoliderType["CrossbowManHorse-1"] = 17;
			SoliderType["CrossbowManHorse-2"] = 18;			
			SoliderType["CrossbowManTank-1"] = 19;
			SoliderType["CrossbowManTank-2"] = 20;			
			SoliderType["Dhuta"] = 21;			
			SoliderType["DoubleHorseTank-1"] = 22;			
			SoliderType["Javelin-1"] = 23;			
			SoliderType["Jinglan"] = 24;			
			SoliderType["SwordFoot-1"] = 25;
			SoliderType["Kongfu-2"] = 26;
			SoliderType["Kongfu-1"] = 27;
			SoliderType["Kongfu-3"] = 28;			
			SoliderType["SpearManHorse-1"] = 29;
			SoliderType["SpearManHorse-2"] = 30;
			SoliderType["SpearManHorse-3"] = 31;			
			SoliderType["SpearManTank-1"] = 32;
			SoliderType["SpearManTank-2"] = 33;			
			SoliderType["Thief-1"] = 34;
			SoliderType["Thief-2"] = 35;
			SoliderType["Thief-3"] = 36;			
			SoliderType["TigerMan"] = 37;
		}
		
		
		                   
	}                      
}